package it.unibz.ti2.internetPizzeria.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Class representing configuration property
 *
 */
@Entity
@Table(name = "PROPERTIES")
public class Property {

	public static final String PizzeriaAddressKey = "PizzeriaAddress";
	public static final String PizzeriaAddressLatKey = "PizzeriaAddressLat";
	public static final String PizzeriaAddressLngKey = "PizzeriaAddressLng";
	public static final String MaxAmountOfEachProductInOrderPropertyKey = "MaxAmountOfEachProductInOrder";
	/**
	 * If property Country equals "" or "null" then it will be not in use.
	 */
	public static final String CountryKey = "Country";
	public static final String DeliveryFreeDistanceInMetersKey = "DeliveryFreeDistanceInMeters";
	public static final String DeliveryFeeIntervalInMetersKey = "DeliveryFeeIntervalInMeters";
	public static final String DeliveryFeeForEveryIntervalInEuroKey = "DeliveryFeeForEveryIntervalInEuro";
	public static final String DeliveryMaximumDistanceFromPizzeriaKey = "DeliveryMaximumDistanceFromPizzeria";

	@Id
	@GeneratedValue
	@Column(name = "PROPERTY_ID")
	private long id;

	@Column(name = "PROPERTY_KEY")
	private String key;

	@Column(name = "PROPERTY_VALUE")
	private String value;

	@Column(name = "PROPERTY_ISNUMBER")
	private boolean isNumber;

	@Column(name = "PROPERTY_ALLOWEDIT")
	private boolean allowEdit;
	
	public boolean isAllowEdit() {
		return allowEdit;
	}

	public void setAllowEdit(boolean allowEdit) {
		this.allowEdit = allowEdit;
	}

	public boolean getIsNumber() {
		return isNumber;
	}

	public void setIsNumber(boolean isNumber) {
		this.isNumber = isNumber;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
